package microservicedemo.bookclient.Client;

import microservicedemo.bookclient.model.Book;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name="book-service",fallback = BookServiceFallback.class)

public interface BookServiceClient {

    @PostMapping("/addBook")
    public boolean addBook(@RequestBody Book book);

    @PostMapping("/delBook")
    public boolean delBook(@RequestBody Book book);

    @PutMapping("/editBook")
    public boolean editBook(@RequestBody Book book);

    @GetMapping("/getByTitle")
    public Book getByTitle(@RequestParam(value = "title") String title);

    @GetMapping("/getByAuthor")
    public Book getByAuthor(@RequestParam(value = "author") String author);
}

